package com.bc.bcbuyerapihttp.controller;

import com.bc.bcapi.service.LanguageService;
import com.bc.bcapi.service.QuestionItemsService;
import com.bc.bcmodel.consts.GlobalSettings;
import com.bc.commonentity.common.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by lianzerong on 2018/10/1.
 */
@RestController
@RequestMapping(value = "/nologon/marvel/")
@Api(value = "常见问题列表")
public class QuestionItemsController {

    private static final Logger LOGGER = LoggerFactory.getLogger(QuestionItemsController.class);

    @Autowired
    QuestionItemsService questionItemsService;

    @Autowired
    LanguageService languageService;

    @ApiOperation(value = "常见问题列表")
    @RequestMapping(value = "questionitems", method = RequestMethod.GET)
    public JsonResult questionitems(HttpServletRequest request, HttpServletResponse response) {
        String language = languageService.getCurrentLanguage(request, response, GlobalSettings.LANGUAGE);
        return questionItemsService.queryQuestionItems(language);
    }


}
